<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWechatArtSourcesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_art_sources', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
        });
        Schema::create('wechat_articles', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('thumb_url')->nullable();
            $table->integer('show_cover_pic')->default(0)->nullable();
            $table->string('author')->nullable();
            $table->string('digest')->nullable();
            $table->string('content')->nullable();
            $table->string('content_source_url')->nullable();
            $table->integer('sources_id');
            $table->integer('index');
            $table->timestamps();
        });

        Schema::create('wechat_art_logs', function (Blueprint $table) {
            $table->increments('id');
            $table->string('as_id');
            $table->string('w_id');
            $table->string('media_id');
            $table->string('url')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechat_art_sources');
        Schema::dropIfExists('wechat_articles');
        Schema::dropIfExists('wechat_art_logs');
    }
}
